package com.yaj.myfactorysupport.controller;


import com.yaj.myfactorysupport.service.VTmRollMngService;
import com.yaj.myfactorysupport.util.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wei
 * @since 2021-05-31
 */
@Api(tags = "VTmRollMngController")
@RestController
@RequestMapping("/myfactorysupport/v-tm-roll-mng")
public class VTmRollMngController {
    @Autowired
    private VTmRollMngService vTmRollMngService;

    @ApiOperation(value = "判断是否存在该PcbId")
    @GetMapping("/ExistPcbId")
    public RespBean ExistPcbId(String pcbId){
        return vTmRollMngService.existPcbId(pcbId);
    }

    @ApiOperation(value="根据PcbId取得部品一览")
    @GetMapping("/GetPartsByPcbId")
    public RespBean GetPartsByPcbId(String pcbId,String smtSide,String mounterType){
        return vTmRollMngService.getPartsByPcbId(pcbId,smtSide,mounterType);
    }

    @ApiOperation(value = "根据PcbId,MounterType取得实装面一览")
    @GetMapping("/GetSmtSideByPcbId")
    public RespBean GetSmtSideByPcbId(@RequestParam(value = "pcbId") String pcbId, @RequestParam(value = "mounterType")String mounterType)
    { return vTmRollMngService.getSmtSideByPcbId(pcbId,mounterType);}

    @ApiOperation(value="查询部品轴管理表信息")
    @GetMapping("GetTmRollMngPcbId")
    public RespBean GetTmRollMngPcbId(String pcbId,String smtSide,String mounterType) {
        return vTmRollMngService.getTmRollMngPcbId(pcbId,smtSide,mounterType);
    }
}

